<template>
  <div class="home-banner">
    <!-- 轮播图 -->
    <XtxCarousel :sliders="sliders" auto-play></XtxCarousel>
  </div>
</template>
<script>
import { findBanner } from '@/api/home.js'
import { ref } from 'vue-demi'
export default {
  name: 'HomeBanner',
  setup () {
    const sliders = ref([])
    findBanner().then((data) => {
      sliders.value = data.result
    })
    return { sliders }
  }
}
</script>
<style scoped lang="less">
// 限制轮播图的大小,能在不同的地方能使用
.home-banner {
  width: 1240px;
  height: 500px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 98;
}
</style>
